
#ifndef INSTRUCTIONS_H_
#define INSTRUCTIONS_H_

#include <string>
#include <sstream>			//B.1.a
using namespace std;

struct Instructions {
public:
	// constructors
	Instructions () {}
	Instructions (string s): instructions(s) {}
    // utility functions
	string display() const {	//B.1.a, modified by TNC B.2
		size_t start, finish;
		string tempStr;
		ostringstream oss;

		start = 0;
		finish = instructions.find('\n');
		while(finish != string::npos){
			tempStr = instructions.substr(start, finish-start);
			oss << tempStr << endl;
			oss << setw(WIDTH) << left << " ";
			oss << setw(WIDTH) << left;

			start = finish+1;
			finish = instructions.find('\n', start);
		}
		tempStr = instructions.substr(start, instructions.length()-1);
		oss << tempStr << endl;

		return oss.str();
	}	//B.1.a

	friend std::ostream& operator<< (std::ostream& os, Instructions &instr) { //Josh B.1
		return os << instr.instructions;
    }
	static const int WIDTH = 13;	//TNC B.2
private:
   //constants
     
   // private data
	string instructions;
};


#endif //INSTRUCTIONS_H_
